#!/bin/bash

# builds natural-theme-bridge-installer for use as a wordpress theme

OUTPUT_DIR="./__output/natural-theme-bridge-installer"

# remove the output directory for a fresh copy
echo "removing __output directory . . ."
rm -rf ./__output

# create the output directory
echo "creating directory structure . . ."
mkdir -p $OUTPUT_DIR

echo "copying necessary files . . ."
cp -r ./js $OUTPUT_DIR
cp -r ./images $OUTPUT_DIR
cp ./bridge-install.php $OUTPUT_DIR
cp ./functions.php $OUTPUT_DIR
cp ./index.php $OUTPUT_DIR
cp ./style-admin.css $OUTPUT_DIR
cp ./style.css $OUTPUT_DIR
cp ./screenshot.png $OUTPUT_DIR

# change directory
echo "changing working directory . . ."
cd $OUTPUT_DIR

# have some cleanup task
echo "cleaning up . . ."

# remove all .svn folders
rm -rf `find . -name .svn`

# go up one level
cd ..

# zip the theme
echo "zipping . . ."
zip -r natural-theme-bridge-installer.zip natural-theme-bridge-installer

echo ""
echo "All done."